Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Save  Emails  That  Are  More  Than  One  Month  Old  

 Content of Save Emails That Are More Than One Month Old.vbs
MD5 Hash: 8553489CF31F1CD29606F7FF83ECD064
On Error Resume Next

Const olFolderSentMail = 5
Const olMSG = 3

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderSentMail)

dtmTargetDate = Date - 30

Set colItems = objFolder.Items
Set colFilteredItems = colItems.Restrict("[CreationTime] <'" & dtmTargetDate & "'")

For Each objMessage In colFilteredItems
strName = objMessage.Subject
strName = Replace(strName, ":", "")
strName = Replace(strName,"/","")
strName = Replace(strName,"\","")
strName = Replace(strName,",","")
strName = Replace(strName, Chr(34),"")
strName = Replace(strName,Chr(39),"")
strName = Replace(strName,"?","")

strName = "C:\Test\" & strName & ".msg"
objMessage.SaveAs strName, olMSG
Next



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a